<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/7/4
 * Time: 13:27
 */

function debug($data){
    if($data){
        echo "<pre>";
        print_r($data);
    }else{
        echo "Êý¾Ý²»´æÔÚ";
    }

}

function get_cover_url($picture){
    if($picture){
        $url = __ROOT__.'/Uploads/'.$picture;
    }else{
        $url = __ROOT__.'/Uploads/photo.jpg';
    }
    return $url;
}

function getpic($content)
{
    $content = html_entity_decode($content);
    //return dump($content);
    preg_match_all("/<img.*>/isU",$content,$ereg);
    if(isset($ereg[0][0])){
        $img = $ereg[0][0];
        return $img;
    }else{
        return "<img src='/ueditor/php/upload/image/20180901/noimg.jpg'/>";
    }
}